Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs, allow comments in admin file with leading whitespace #737

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

simonLeary42
Copy link
Contributor

I wasn't sure if I could add comments to my admin file. The source code says I can, but only if the # character is at the very beginning.

Lmod/src/utils.lua

Lines 423 to 425 in b46bcc8

if (v:sub(1,1) == "#") then
-- ignore this comment line
break

Updated the docs and made it so that comments are recognized even if there is witespace before it.

tested:

$ env -iS /bin/bash --norc --noprofile
bash-5.0$ source ~/Lmod-build/lmod/lmod/init/profile
bash-5.0$ export LMOD_ADMIN_PATH=/home/simonleary_umass_edu/Lmod-test/adminfile
bash-5.0$ module --config 2>&1 | grep 'Admin file'
Admin file                                                    /home/simonleary_umass_edu/Lmod-test/adminfile
bash-5.0$ cat /home/simonleary_umass_edu/Lmod-test/adminfile
# comment 1
    # comment 2
lmod:
    hello, world!
bash-5.0$ ml lmod
-------------------------------------------------------------------------------------------------------------------------------------------
There are messages associated with the following module(s):
-------------------------------------------------------------------------------------------------------------------------------------------

lmod:
    hello, world!

-------------------------------------------------------------------------------------------------------------------------------------------

@rtmclay rtmclay merged commit 9e2b344 into TACC:main Nov 28, 2024
9 checks passed
@rtmclay
Copy link
Member

rtmclay commented Nov 28, 2024

Thanks for the patch!

rtmclay pushed a commit that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants